package com.example.index

import android.annotation.SuppressLint
import android.content.Context
import android.content.res.Configuration
import androidx.appcompat.app.AppCompatActivity
import com.example.index.system.LocaleManager

@SuppressLint("Registered")
open class BaseActivity : AppCompatActivity() {


    override fun applyOverrideConfiguration(overrideConfiguration: Configuration?) {

        overrideConfiguration?.setLocale(LocaleManager.locale)
        super.applyOverrideConfiguration(overrideConfiguration)
    }

    override fun attachBaseContext(newBase: Context?) {
        super.attachBaseContext(LocaleManager.createLocaleConfiguredContext(newBase))
    }

}